<div id="ajaxlistbox" style=" min-height:600px;">
          <volist name="list" id="vo">
<!--添加界面引导 BY zmx-->
            <div class="col-xs-12 missionform" style="" <eq name="key" value="0">data-position="right" data-intro="这里处理审批文件的地方，每一个就是一个待审批的文案，里面展示了该审批的内容，你可以快速的预览并且做出判断，之后通过下面的【通过】【驳回】按钮快速完成审批工作，系统后台会将结果通知到申请人"</eq>>
              <div class="panel" style="margin:5px 0; position:relative; box-shadow: 2px 2px 5px #aaa; border-radius:0; border:1px solid #ccc; padding:15px;"> 
                <!--{$html.$i}-->
                
                <div class="BatchOperation BatchOperationBtn">
                  <input class="checkbox" type="checkbox" name="id[]" value="{$vo.id}">
                  <i class="fa icon-check"></i>
                  <div class="fabg"> </div>
                </div>
                <h4 class="panel-heading">内容</h4>
                <div class="formBox <eq name="vo['state']" value="0"> a</eq>
                  <eq name="vo['state']" value="3">p</eq>
                  " id="formBox-{$vo.id}">{$vo['formtemplate']} </div>
                <h4 class="panel-heading">审批意见</h4>
                <div class="schedulebox" id="schedulebox-{$vo.id}">
                <?php //dump($vo['schedule']); ?>
                  <notempty name="vo['schedule']">
                    <volist name="vo['schedule']" id="s">
                      <p>意见：
                        <notempty name="s['comment']">{$s.comment}
                          <else/>
                          无</notempty>
                        <eq name="s['status']" value="0"> 　<span class="label label-danger">驳回</span> </eq>
                        <eq name="s['status']" value="1"> 　<span class="label label-success">通过</span> </eq>
                        <gt name="s['sendParent']" value="0"><span class="label label-info">已递交上级</span></gt>
                      </p>
                      <p></p>
                      <p><span class="pull-left">{:date('Y-m-d H:i:s', $s['datatime'])}</span><span class="pull-right">审批人：{$s.membername}</span>
                      <div class="clearfix"> </div>
                      </p>
                      <hr>
                    </volist>
                    <else/>
                    <div style="padding:5px; text-align:center;"> 暂无审批记录 </div>
                  </notempty>
                </div>
                <div id="schedulebox-{$vo.id}pages"> </div>
                <form id="schedulebox-{$vo.id}form" action="{:U('schedule', array('id' => $vo['id']))}">
                </form>
                <div class="panel" style="border:1px solid #ccc; margin-bottom:0;">
                  
 <!--添加界面引导 BY zmx-->

                  <form id="passform-{$vo.id}" action="{:U('pass')}">
                    <textarea class="form-control input-lg p-text-area" name="comment" rows="2" placeholder="填写意见">{$vo.myschedule.comment}</textarea>
                    <input type="hidden" value="0" name="status">
                    <input type="hidden" name="mission_id" value="{$vo['id']}">
                  </form>
                  <footer class="panel-footer" style="padding:5px;"> 
                      <button onClick="passform{$vo.id}(1);" class="btn btn-post btn-sm pull-right" >通过</button>
                      <button style="margin-right:5px;" class="btn btn-default btn-sm pull-right" onClick="passform{$vo.id}(0);" >驳回</button>
                    <ul class="nav nav-pills p-option">
                      <li style="line-height:30px;"> 申请人：{$vo['proposername']} </li>
                    </ul>
                  </footer>
                  <script>
				  $('#formBox-{$vo.id} form').removeClass('checkoutform');
								    function passform{$vo.id}(status){
									    $('#passform-{$vo.id}').find('input[name="status"]').val(status);
										var data = $('#passform-{$vo.id}').serialize();
										$.ajax({
											url:$('#passform-{$vo.id}').attr('action'),
											data:data,
											type:'POST',
											dataType:"json",
											success: function(ret){
												if(ret.status == 1){
													//成功了
													//document.getElementById('passform-{$vo.id}').reset();
													$('#schedulebox-{$vo.id}form').trigger('submit');
													
													if(ret.state == 3){
														$('#formBox-{$vo.id}').css('background-size','100% auto');
														$('#formBox-{$vo.id}').removeClass('a');
														$('#formBox-{$vo.id}').addClass('p');
														
													}
													if(ret.state == 0){
														$('#formBox-{$vo.id}').css('background-size','100% auto');
														$('#formBox-{$vo.id}').removeClass('p');
														$('#formBox-{$vo.id}').addClass('a');
														
														
													}
													setTimeout(function(){
														$('#formBox-{$vo.id}').css('background-size','50% auto');
														$('#missioncountboxform').submit();
														$('#ajaxlistboxform').submit();
													},30);
												}
												//如果没有表格则弹窗
												if(ret.status == 2){
													_openWindow('{:U('choiceForm') }&'+data, 500, '选择表格', '确认', null, '');
												}
											}
										});
									}
								</script> 
                </div>
              </div>
            </div>
            
            <!-- 数据主体结束 --> 
          </volist>
          </div>
<script>
 
	
	$('.schedulebox').ajaxlist({autoload:false});
	
	//当数据成功获取的时候将表单转化为纯文
	$('.formBox .form-control').each(function(index, element) {
		var val = $(this).val();
		$(this).replaceWith('<span style="color:#f60;">'+val+'</span>');
	});
	//当数据成功获取的时候将选择项转化为纯文本
	$('.formBox .checkbox').each(function(index, element) {
		if($(this).find("input")[0].checked){
			$(".formBox hr").remove();
			var val=$(this).find("input").next().text();
			$(this).parent().replaceWith('<span style="color:#f60;">'+val+'</span>');
		}else{
			$(this).parent().remove();	
		};
		
	});
    $('.icheck input').change(function(){
        $('#ajaxlistboxform').submit();
    });
    $.cookie('loadIndexUrl', window.location.href, {path:'/'});
    function mission_send(id,e){
        if(!confirm('确定递交吗？')){
            return false;
        }
        hideLayer();
        $.post('{:U('send')}', {id:id}, function(data){
            if(data.status == 1){
				$('#ajaxlistboxform').submit();
                //updateList();
            }else{
                alert(data.info);
            }
        }, 'json');
    }
    function mission_cancel(id,e){
        if(!confirm('确定取消吗？')){
            return false;
        }
        hideLayer();
        $.post('{:U('cancel')}', {id:id}, function(data){
            if(data.status == 1){
				$('#ajaxlistboxform').submit();
                //updateList();
            }else{
                alert(data.info);
            }
        }, 'json');
    }
	
	
	
</script>
<style>
.hiddentop{padding-top:0 !important;}
.formBox.a{background:url(__PUBLIC__/a.png) no-repeat center center; background-size:50% auto;}.formBox.p{background:url(__PUBLIC__/p.png) no-repeat center center; background-size:50% auto;}
</style>